package com.example.m522;

import android.os.Bundle;

import androidx.activity.EdgeToEdge;
import androidx.appcompat.app.AppCompatActivity;
import androidx.core.graphics.Insets;
import androidx.core.view.ViewCompat;
import androidx.core.view.WindowInsetsCompat;

import java.util.Map;

public class MainActivity extends AppCompatActivity {
    private ExchangeRateManager rateManager;

    @Override
    protected void onCreate(Bundle savedInstanceState) {
        super.onCreate(savedInstanceState);
        setContentView(R.layout.activity_main);

        rateManager = new ExchangeRateManager(this);

        // 获取汇率数据
        rateManager.fetchLatestRates();
        Map<String, Double> rates = rateManager.getRates();

        // 使用汇率数据更新UI
        updateUI(rates);
    }

    private void updateUI(Map<String, Double> rates) {
        // 更新UI的代码
    }
}